import { Module } from '@nestjs/common';
import { PassportModule } from '@nestjs/passport';
import { JwtModule } from '@nestjs/jwt';

import { AuthService } from './app.service';
import { AppStrategy } from './app.strategy';

import config from 'src/config';
import { RedisModule } from '@liaoliaots/nestjs-redis';

@Module({
	imports: [
		PassportModule,
		JwtModule.register({
			secret: config.app.secret,
			signOptions: { expiresIn: config.app.expiresIn },
		}),
		RedisModule.forRoot({
			config:{
				url:`redis://:${config.redis.password}@${config.redis.host}:${config.redis.port}/${config.redis.db}`,
				namespace:"LoginUser"
			}
		},false),
	],
  	providers: [AuthService,AppStrategy],
	exports: [AuthService],
})
export class AuthModule {}
